package com.yun.util.yun.utils.date;

import com.yun.util.yun.utils.UUIDUtil;
import org.apache.commons.codec.digest.DigestUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * ticket create

 */
public class TicketUtil {

	/**
	 * 随机生成Ticket
	 * 
	 * @return
	 */
	public static String getTicketID() {

		String uuid = UUIDUtil.getUUID();
		String sysTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
				.format(new Date());
		sysTime = uuid + "-" + sysTime;
		return uuid + DigestUtils.shaHex(sysTime);
	}
}